// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/iconfont.css'
import '@/assets/styles/main.scss'
import proper from '@/config/property'
import store from './vuex/store'
import UserApi from '@/api/api_user.js'
import valid from '@/utils/valid.js'
Vue.prototype.$proper = proper
Vue.config.productionTip = false
Vue.prototype.valid = valid
Vue.use(ElementUI, {size: 'small'})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  store,
  router,
  template: '<App/>',
  components: {App},
  beforeCreate(){
    UserApi.getUserInfo().then(result => {
      this.$store.state.userInfo = result.data
    })
    store.dispatch('loadData')
  }
})
